<!doctype html>
<html>
		<head>
		<meta charset="utf-8">
		<title>讨论区</title>
		<?php echo $this->render('/_include/_header');?>
		<script type="text/javascript">
		var myScroll;
		var param = {};
        var page = 1;
		var forumid = '';
		function loaded () {
			$(window).scroll(function(e) {
		
				if ($(document).scrollTop() >= $(document).height() - $(window).height()) {
					$('#pullUp').show();
					var h = $('#pullUp').outerHeight(true);
					$(document).scrollTop($(document).height() - $(window).height())
					
					setTimeout(function(){
						
					},500);
				}
			});

			
			get_data();
		}


    function get_data(refresh){
        if(refresh){
             page = 1;
        }
        param = {"condition[forumid]": forumid};
        ScrollData({
			ajax_url: 'http://pvoice.chinamobo.com/function_php/api/index.php/community_post',
			lastpage_tips: true,
            div: '.data-list',
            data: param,
        },function(data){
			
		});
    }
	
/* 	 		function reply_no(){
			 if($('.reply-block').val('')){
				 $('.all-reply').removeClass('bor-t-e0e0e0');
				 }
			  }*/
	
	
						
			function change_tab(i) {				
			$('.data-list:last').html('');
            forumid = i;
			get_data(true);
			}
		</script>
		</head>

		<body class="bg-eeeeee">
<div class="header-fixed">
          <header>
    <div id="header" class="fixed">
              <div class="btn-return ub-img5 " onClick="goback();"></div>
              <h1><span onClick="location.reload();">讨论区</span></h1>
              <div class="btn-post ub-img5 " onClick="href('<?php echo $this->createUrl('community/post')?>')"></div>
            </div>
  </header>
        </div>
<div id="wrapper2" style="padding-top:3em;">
          <div id="scroller2">
          <ul id="ul">
    <div class="title-list">
              <div class="housing-switch margin-body bg-fff uc-a1">
        <div class="ub">
                  <input type="radio" class="uhide" name="post" value="0" checked>
                  <div class="tx-middle four"  onclick="zy_for(event);change_tab('');">最新</div>
                  <input type="radio" class="uhide" name="post" value="1" id="1">
                  <div class="tx-middle four"  onclick="zy_for(event);change_tab(1);">创业区</div>
                  <input type="radio" class="uhide" name="post" value="2" id="2">
                  <div class="tx-middle four"  onclick="zy_for(event);change_tab(2);">生活区</div>
                  <input type="radio" class="uhide" name="post" value="3" id="3">
                  <div class="tx-middle four-no"  onclick="zy_for(event);change_tab(3);">个人风采</div>
                </div>
      </div>
            </div>
    <div id="dataLoding" class="loading">
              <p class="ub-pc ub"> <span></span>正在加载数据... </p>
            </div>
    <div>
              <div class="page1">
        <div class="data-list uhide"> {{each list as v i}}
                  <div class=" post-list touch bg-fff margin-body">
            <dl class=" uinn" onClick="href('<?php echo $this->createUrl('community/details')?>?id={{v.postid}}')">
                      <div class="ub">
                <div class="margin-r-10" ><a href="#"> <img src="http://pvoice.chinamobo.com/function_php/{{v.avatar}}" class="avatar avatar-30"></a> </div>
                <div class="ub-f1">
                          <div class="index_111 ulev1"><a href="#" class="c-5ca31d">{{v.userid}}</a></div>
                          <div class="ub ulev-1 title">
                    <div class="icon-title ub ulev-1  c-747474">
                              <div class="ub">
                        <div class="icon-time item"></div>
                        <span class="ub-f1">{{dateFormatDiff(v.addtime)}}</span> </div>
                              <div class="ub margin-l-10">
                        <div class="icon-news item"></div>
                        <span class="ub-f1">{{v.replys?v.replys:'0'}} </span> </div>
                            </div>
                  </div>
                        </div>
              </div>
                      <div class="ulev-1 margin-t-10 c-747474 con-text ub"><a href="post_details.html"><span>{{v.subject}}</span> {{if v.images ==''}}{{else}}
                        <div class="con-img"></div>
                        {{/if}} </a></div>
                    </dl>
            <a href="<?php echo $this->createUrl('community/details')?>?id={{v.postid}}" class="c-6fba2c">
                    <div class="reply">
              <div class="reply-list" > {{each v.replylist as vv ii}}
                        <div class="ub reply-block bor-b-e0e0e0" >
                  <div><img src="http://pvoice.chinamobo.com/function_php/{{v.avatar}}" class="small-avatar"></div>
                  <span class="c-5ca31d">{{vv.username}}</span> <span class="ub-f1 c-747474 ulev-1">{{vv.content}}</span> </div>
                        {{/each}} </div>
              <div class="reply-list"> </div>
            </div>
            {{if !isnull(v.replylist)}}
                    <div class="all-reply ulev-1 bor-b-e0e0e0">查看全部回复</div>
                    {{/if}}
                    </a> </div>
                  {{/each}} </div>
        <div class="data-list"> </div>
      </div>
            </div>
    </div>
    <div id="pullUp" style="display:none; margin-bottom:4em;">
    <div class="ub ub-pc">
              <div class="pullUpIcon ub-img4"></div>
              <div class="pullUpLabel">正在加载...</div>
            </div>
  </ul>
        </div>
</div>
<?php echo $this->render('/_include/_footer');?> 
<script>
$(function(){
	loaded();
    Dbug(1);
   	
});

</script>
</body>
</html>